Free sector manager for data stored in flash memory devices

ABSTRACT

A flash driver tracks data stored in a flash memory device through the use of logical-to-physical sector mapping. The mapping is stored in a data structure and allows data to be written into the next free physical sector in the flash memory medium. Write operations complete quickly, because there is no need to perform an erase operation in order to write new data on to the flash memory medium. Data loss due to power interruption during a write operation is also minimized by the described implementations. The logical-to-physical sector mapping stored in data structure is backed-up on the flash memory medium. In the event there is a catastrophic power interruption, logical-to-physical sector mapping can easily be reestablished by scanning the backed-up mapping in the flash memory medium. The backed-up information can be stored in a spare portion of a NAND or NOR flash memory medium.

RELATED APPLICATION

[0001] This application is a continuation of and claims priority fromthe co-pending U.S. patent application Ser. No. 10/087,590, filed Feb.27, 2002, entitled “System and Method for Tracking Data Stored in aFlash Memory Device.”

TECHNICAL FIELD

[0002] This invention relates to flash memory devices, and flash memorycontrollers.

BACKGROUND

[0003] Flash memory devices have many advantages for a large number ofapplications. These advantages include their non-volatility, speed, easeof erasure and reprogramming, small physical size and related factors.There are no mechanical moving parts and as a result such systems arenot subject to failures of the type most often encountered with harddisk storage systems. As a result many portable computer devices, suchas laptops, portable digital assistants, portable communication devices,and many other related devices are using flash memory as the primarymedium for storage of information.

[0004] Flash memory devices are generally operated by first setting allbits in a block to a common state, and then reprogramming them to adesired new state. Blocks of data need to be shuffled during thereprogramming process, which can slow the completion of the operation.Besides being time consuming, reprogramming a block of data can subjectthe entire block to accidental loss, in the event there is a powerfailure during the reprogramming process. Normally, as the block isshuffled, it is temporarily stored in a volatile memory device, such asRandom Access Memory (RAM). The entire block of data (not just newlyentered data) is susceptible to permanent loss if the reprogrammingprocess has not completed prior to the power failure. In thesecircumstances, an entire block of data may need to be reentered by auser anew.

SUMMARY

[0005] A system and method for tracking data stored in a flash memorydevice is described. The system and method allows write operations tocomplete without interruption, because there is no requirement toperform an erase operation in order to perform a write operation to theflash memory medium.

[0006] In one described implementation, a request to write data to alogical sector address of a flash memory medium is received from a filesystem. A free physical sector address is assigned to the logical sectoraddress, which forms a corresponding relationship between these twoaddresses. This corresponding relationship is stored in a table. Thedata is then written into a physical sector of the flash memory mediumat a location indicated by the physical sector address.

[0007] Data loss, due to power interruption during a write operation, isalso minimized in a described implementation. The logical-to-physicalsector mapping stored in the table is backed-up on the flash memorymedium. In the event there is a catastrophic power interruption,logical-to-physical sector mapping can easily be reestablished byscanning the backed-up mapping stored on the flash memory medium. Forexample, a logical address sector corresponding to a physical addresssector can be stored in the error code correction portion of a NANDflash memory medium or within the physical sector of a NOR flash memorymedium.

BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The detailed description is described with reference to theaccompanying figures. In the figures, the left-most digit(s) of areference number identifies the figure in which the reference numberfirst appears.

[0009]FIG. 1 illustrates a logical representation of a NAND flash memorymedium.

[0010]FIG. 2 illustrates a logical representation of a NOR flash memorymedium.

[0011]FIG. 3 illustrates pertinent components of a computer device,which uses one or more flash memory devices to store information.

[0012]FIG. 4 illustrates a block diagram of flash abstraction logic.

[0013]FIG. 5 illustrates an exemplary block diagram of a flash mediumlogic.

[0014]FIG. 6A shows a data structure used to store a correspondingrelationship between logical sector addresses and physical sectoraddresses.

[0015]FIG. 6B shows a data structure which is the same as the datastructure in FIG. 6B, except its contents have been updated.

[0016]FIG. 7 illustrates a process used to track data on the flashmemory medium when the file system issues write requests to the flashdriver.

[0017]FIG. 8 illustrates a process for safeguarding mapping oflogical-to-physical sector address information stored in volatile datastructures, such as the data structures shown in FIGS. 6A and 6B.

[0018]FIG. 9 illustrates a location within the flash memory medium inwhich the logical sector address can be stored for safeguarding in theevent of a power failure.

[0019]FIG. 10 illustrates a dynamic look-up data structure to track datastored in the flash memory medium.

[0020]FIG. 11 illustrates a process for dynamically allocating look-updata structures for tracking data on the flash memory medium.

[0021]FIG. 12 is a diagram of the flash memory medium viewed and/ortreated as a continuous circle by the flash driver.

[0022]FIG. 13 depicts another illustration of the media viewed as acontinuous circle.

[0023]FIG. 14 illustrates a process used by the sector manager todetermine the next available free sector location for the flash driverto store data on the medium.

[0024]FIG. 15 illustrates another view of media treated as a continuouscircle.

[0025]FIG. 16 is a flow chart illustrating a process used by thecompactor to recycle sectors.

[0026]FIG. 17 shows one exemplary result from the process illustrated inFIG. 16.

[0027]FIG. 18 illustrates a logical representation of a NOR flash memorymedium divided in way to better support the processes and techniquesimplemented by the flash driver.

DETAILED DESCRIPTION

[0028] The following discussion is directed to flash drivers. Thesubject matter is described with specificity to meet statutoryrequirements. However, the description itself is not intended to limitthe scope of this patent. Rather, the inventors have contemplated thatthe claimed subject matter might also be embodied in other ways, toinclude different elements or combinations of elements similar to theones described in this document, in conjunction with other present orfuture technologies.

[0029] Overview

[0030] This discussion assumes that the reader is familiar with basicoperating principles of flash memory media. Nevertheless, a generalintroduction to two common types of nonvolatile random access memory,NAND and NOR Flash memory media, is provided to better understand theexemplary implementations described herein. These two example flashmemory media were selected for their current popularity, but theirdescription is not intended to limit the described implementations tothese types of flash media. Other electrically erasable and programmableread-only memories (EEPROMs) would work too. In most examples usedthroughout this Detailed Description numbers shown in data structuresare in decimal format for illustrative purposes.

[0031] Universal Flash Medium Operating Characteristics

[0032]FIG. 1 and FIG. 2 illustrate logical representations of exampleNAND and NOR flash memory media 100, 200, respectively. Both media haveuniversal operating characteristics that are common to each,respectively, regardless of the manufacturer. For example referring toFIG. 1, a NAND flash memory medium is generally split into contiguousblocks (0, 1, through N). Each block 0, 1, 2, etc. is further subdividedinto K sectors 102; standard commercial NAND flash media commonlycontain 8, 16, or 32 sectors per block. The amount of blocks and sectorscan vary, however, depending on the manufacturer. Some manufacturersrefer to “sectors” as “pages.” Both terms as used herein are equivalentand interchangeable.

[0033] Each sector 102 is further divided into two distinct sections, adata area 103 used to store information and a spare area 104 which isused to store extra information such as error correction code (ECC). Thedata area 103 size is commonly implemented as 512 bytes, but again couldbe more or less depending on the manufacturer. At 512 bytes, the flashmemory medium allows most file systems to treat the medium as anonvolatile memory device, such as a fixed disk (hard drive). As usedherein RAM refers generally to the random access memory family of memorydevices such as DRAM, SRAM, VRAM, VDO, and so forth. Commonly, the sizeof the area spare 104 is implemented as 16 bytes of extra storage forNAND flash media devices. Again, other sizes, greater or smaller can beselected. In most instances, the spare area 104 is used for errorcorrecting codes, and status information.

[0034] A NOR memory medium 200 is different than NAND memory medium inthat blocks are not subdivided into physical sectors. Similar to RAM,each byte stored within a block of NOR memory medium is individuallyaddressable. Practically, however, blocks on NOR memory medium canlogically be subdivided into physical sectors with the accompanyingspare area.

[0035] Aside from the overall layout and operational comparisons, someuniversal electrical characteristics (also referred to herein as “memoryrequirements” or “rules”) of flash devices can be summarized as follows:

[0036] 1. Write operations to a sector can change an individual bit froma logical ‘1’ to a logical ‘0’, but not from a logical ‘0’ to logical‘1’ (except for case No. 2 below);

[0037] 2. Erasing a block sets all of the bits in the block to a logical‘1’;

[0038] 3. It is not generally possible to erase individualsectors/bytes/bits in a block without erasing all sectors/bytes withinthe same block;

[0039] 4. Blocks have a limited erase lifetime of between approximately100,000 to 1,000,000 cycles;

[0040] 5. NAND flash memory devices use ECC to safeguard against datacorruption due to leakage currents; and

[0041] 6. Read operations do not count against the write/erase lifetime.

[0042] Flash Driver Architecture

[0043]FIG. 3 illustrates pertinent components of a computer device 300,which uses one or more flash memory devices to store information.Generally, various different general purpose or special purposecomputing system configurations can be used for computer device 300,including but not limited to personal computers, server computers,hand-held or laptop devices, portable communication devices,multiprocessor systems, microprocessor systems, microprocessor-basedsystems, programmable consumer electronics, gaming systems, multimediasystems, the combination of any of the above example devices and/orsystems, and the like.

[0044] Computer device 300 generally includes a processor 302, memory304, and a flash memory media 100/200. The computer device 300 caninclude more than one of any of the aforementioned elements. Otherelements such as power supplies, keyboards, touch pads, I/O interfaces,displays, LEDs, audio generators, vibrating devices, and so forth arenot shown, but could easily be a part of the exemplary computer device300.

[0045] Memory 304 generally includes both volatile memory (e.g., RAM)and non-volatile memory (e.g., ROM, PCMCIA cards, etc.). In mostimplementations described below, memory 304 is used as part of computerdevice's 302 cache, permitting application data to be accessed quicklywithout having to permanently store data on a non-volatile memory suchas flash medium 100/200.

[0046] An operating system 309 is resident in the memory 304 andexecutes on the processor 302. An example operating systemimplementation includes the Windows®CE operating system from MicrosoftCorporation, but other operation systems can be selected from one ofmany operating systems, such as DOS, UNIX, etc. For purposes ofillustration, programs and other executable program components such asthe operating system are illustrated herein as discrete blocks, althoughit is recognized that such programs and components reside at varioustimes in different storage components of the computer, and are executedby the processor(s) of the computer device 300.

[0047] One or more application programs 307 are loaded into memory 304and run on the operating system 309. Examples of applications include,but are not limited to, email programs, word processing programs,spreadsheets programs, Internet browser programs, as so forth.

[0048] Also loaded into memory 304 is a file system 305 that also runson the operating system 309. The file system 305 is generallyresponsible for managing the storage and retrieval of data to memorydevices, such as magnetic hard drives, and this exemplary implementationflash memory media 100/200. Most file systems 305 access and storeinformation at a logical level in accordance with the conventions of theoperating system the file system 305 is running. It is possible for thefile system 305 to be part of the operating system 309 or embedded ascode as a separate logical module.

[0049] Flash driver 306 is implemented to function as a direct interfacebetween the file system 305 and flash medium 100/200. Flash driver 306enables computer device 300 through the file system 305 to control flashmedium 100/200 and ultimately send/retrieve data. As shall be describedin more detail, however, flash driver 306 is responsible for more thanread/write operations. Flash driver 306 is implemented to maintain dataintegrity, perform wear-leveling of the flash medium, minimize data lossduring a power interruption to computer device 300 and permit OEMs ofcomputer devices 300 to support their respective flash memory devicesregardless of the manufacturer. The flash driver 306 is file systemagnostic. That means that the flash driver 306 supports many differenttypes of files systems, such as File Allocation Data structure FileSystem (FAT16), (FAT32), and other file systems. Additionally, flashdriver 306 is flash memory medium agnostic, which likewise means driver306 supports flash memory devices regardless of the manufacturer of theflash memory device. That is, the flash driver 306 has the ability toread/write/erase data on a flash medium and can support most, if notall, flash devices.

[0050] In the exemplary implementation, flash driver 306 resides as acomponent within operating system 309, that when executed serves as alogical interface module between the file system 305 and flash medium100/200. The flash driver 306 is illustrated as a separate box 306 forpurposes of demonstrating that the flash driver when implemented servesas an interface. Nevertheless, flash driver 306 can reside in otherapplications, part of the file system 305 or independently as separatecode on a computer-readable medium that executes in conjunction with ahardware/firmware device.

[0051] In one implementation, flash driver 306 includes: a flashabstraction logic 308 and a programmable flash medium logic 310. Flashabstraction logic 308 and programmable medium logic 310 are codedinstructions that support various features performed by the flash driver306. Although the exemplary implementation is shown to include these twoelements, various features from each of the flash abstraction logic 308and flash medium logic 310 may be selected to carry out some of the morespecific implementations described below. So while the describedimplementation shows two distinct layers of logic 308/310, many of thetechniques described below can be implemented without necessarilyrequiring all or a portion of the features from either layer of logic.Furthermore, the techniques may be implemented without having the exactdivision of responsibilities as described below.

[0052] In one implementation, the Flash abstraction logic 308 managesthose operating characteristics that are universally common to flashmemory media. These universal memory requirements include wear-leveling,maintaining data integrity, and handling recovery of data after a powerfailure. Additionally, the flash abstraction logic 308 is responsiblefor mapping information stored at a physical sector domain on the flashmemory medium 100/200 to a logical sector domain associated with thefile system 305. That is, the flash abstraction logic 308 tracks datagoing from a logical-to-physical sector addresses and/or from aphysical-to-logical sector addresses. Driver 306 useslogical-to-physical sector addresses for both read/write operations.Driver 306 goes from physical-to-logical sector addresses when creatinga look-up table (to be described below) during driver initialization.Some of the more specific commands issued by the file system that aredependent upon a certain type of flash memory media are sent directly tothe flash medium logic 310 for execution and translation. Thus, theflash abstraction logic 308 serves as a manager to those universaloperations, which are common to flash memory media regardless of themanufacturer for the media, such as wear-leveling, maintaining dataintegrity, handling data recovery after a power failure and so forth.

[0053]FIG. 4 illustrates an exemplary block diagram of the flashabstraction logic 308. Flash abstraction logic 308 includes a sectormanager 402, a logical-to-physical sector mapping module 404, and acompactor 406. Briefly, the sector manager 402 provides a pointer to asector available, i.e., “free” to receive new data. Thelogical-to-physical sector mapping module 404 manages data as it goesfrom a file system domain of logical sector addressing to a flash mediumdomain of physical sector addressing. The compactor 406 provides amechanism for clearing blocks of data (also commonly referred to in theindustry as “erasing”) to ensure that enough free sectors are availablefor writing data. Additionally, the compactor 406 helps the driver 306system perform uniform and even wear leveling. All these elements shallbe described in more detail below.

[0054] Referring back to FIG. 3, the flash medium logic 310 is used totranslate logical commands, received from either the flash abstractionlogic 308 or file system 305, to physical sector commands for issuanceto the flash memory medium 100/200. For instance, the flash medium logic310 reads, writes, and erases data to and/or from the flash memorymedium. The flash medium logic 310 is also responsible for performingECC (if necessary). In one implementation, the flash medium logic 310 isprogrammable to permit users to match particular flash mediumrequirements of a specific manufacturer. Thus, the flash medium logic310 is configured to handle specific nuances, ECC, and specific commandsassociated with controlling physical aspects of flash medium 100/200.

[0055]FIG. 5 illustrates an exemplary block diagram of the flash mediumlogic 310. As shown, the flash medium logic 310 includes a programmableentry point module 502, I/O module 504 and an ECC module 506. Theprogrammable entry point module 502 defines a set of programminginterfaces to communicate between flash abstraction logic 308 and flashmedium 100/200. In other words, the programmable entry points permitmanufacturers of computer devices 300 to program the flash media logic310 to interface with the actual flash memory medium 100/200 used in thecomputer device 300. The I/O module 504 contains specific code necessaryfor read/write/erase commands that are sent to the Flash memory medium100/200. The user can program the ECC module 506 to function inaccordance with any particular ECC algorithm selected by the user.

[0056] Tracking Data

[0057] File system 305 uses logical sector addressing to read and storeinformation on flash memory medium 100/200. Logical sector addresses areaddress locations that the file system reads and writes data to. Theyare “logical” because they are relative to the file system. Inactuality, data may be stored in completely different physical locationson the flash memory medium 100/200. These physical locations arereferred to as physical sector addresses.

[0058] The flash driver 306 is responsible for linking all logicalsector address requests (i.e., read & write) to physical sector addressrequests. The process of linking logical-to-physical sector addresses isalso referred to herein as mapping. Going from logical to physicalsector addresses permits flash driver 306 to have maximum flexibilitywhen deciding where to store data on the flash memory medium 100/200.The logical-to-physical sector mapping module 404 permits data to beflexibly assigned to any physical location on the flash memory medium,which provides efficiency for other tasks, such as wear-leveling andrecovering from a power failure. It also permits the file system 305 tostore data in the fashion it is designed to do so, without needingintelligence to know that the data is actually being stored on a flashmedium in a different fashion.

[0059]FIG. 6A shows an exemplary implementation of a data structure(i.e., a table) 600A generated by the flash driver 306. The datastructure 600A is stored in a volatile portion of memory 304, e.g. RAM.The data structure 600A includes physical sector addresses 602 that havea corresponding logical sector address 604. An exemplary description ofhow table 600A is generated is described with reference to FIG. 7.

[0060]FIG. 7 illustrates a process 700 used to track data on the flashmemory medium 100/200 when the file system 305 issues write requests tothe flash driver 306. Process 700 includes steps 702-718. Referring toFIGS. 6A and 7, in step 702, flash abstraction logic 308 receives arequest to write data to a specified logical sector address 604.

[0061] In step 704, the sector manager 402 ascertains a free physicalsector address location on the flash medium 100/200 that can accept dataassociated with the write request (how the sector manager 402 choosesphysical sector addresses will be explained in more detail below). Afree physical sector is any sector that can accept data without the needto be erased first. Once the sector manager 402 receives the physicalsector address associated with a free physical sector location, thelogical-to-physical sector mapping module 404 assigns the physicalsector address to the logical sector address 604 specified by writerequest forming a corresponding relationship. For example, a physicalsector address of 0 through N can be assigned to any arbitrary logicalsector address 0 through N.

[0062] Next, in step 706, the logical-to-physical sector mapping module404 stores the corresponding relationship of the physical sector addressto the logical sector address in a data structure, such as the exemplarytable 600A in memory 305. As shown in the exemplary data structure 600A,three logical sector addresses 604 are assigned to correspondingphysical sector addresses 602.

[0063] Next, in step 708 data associated with the logical sector addresswrite request is stored on the flash medium 100/200 at the physicalsector address location assigned in step 704. For example, data would bestored in physical sector address location of zero on the medium100/200, which corresponds to the logical sector address of 11.

[0064] Now, in step 710, suppose for example purposes the file system305 issues another write request, but in this case, to modify dataassociated with a logical sector address previously issued in step 702.Then, flash driver 306 performs steps 712 through 714, which areidentical to steps 704 through 708, respectively, which are describedabove.

[0065] In step 718, however, after the updated data associated with step710 is successfully stored on the flash medium 100/200, thelogical-to-physical sector mapping module 404 marks the old physicalsector address assigned in step 704 as “dirty.” Old data is marked dirtyafter new data is written to the medium 100/200, so in the event thereis a power failure in the middle of the write operation, thelogical-to-physical sector mapping module 404 will not lose old data. Itis possible to lose new or updated data from steps 702 or 710, but sincethere is no need to perform an erase operation only one item of new ormodified data is lost in the event of a power failure.

[0066]FIG. 6B shows a data structure 600B which is the same as datastructure 600A, except its contents have been updated. In this examplethe file system 305 has updated data associated with logical sectoraddress 11. Accordingly, the flash driver 306 reassigns logical sectoraddress 11 to physical sector address 3 and stores the reassignedcorresponding relationship between the these two addresses in datastructure 600B. As illustrated in data structure 600B, the contents oflogical sector 11 are actually written to physical sector address 3 andthe contents of sector 0 are marked “dirty” after the data contents aresuccessfully written into physical sector address 3 as was describedwith reference to steps 710-718.

[0067] This process of reassigning logical-to-physical sector addresswhen previously stored data is updated by the file system 305, permitswrite operations to take place without having to wait to move an entireblock of data and perform an erase operation. So, process 700 permitsthe data structure to be quickly updated and then the physical writeoperation can occur on the actual physical medium 100/200. Flashabstraction logic 308 uses the data structures, such as 600A/600B, tocorrectly maintain logical-to-physical mapping relationships.

[0068] When there is a read request issued by the files system 305, theflash abstraction logic 308, through the logical-to-physical mappingmodule 404, searches the data structure 600A/600B to obtain the physicalsector address which has a corresponding relationship with the logicalsector address associated with read request. The flash medium logic 310then uses that physical sector address as a basis to send dataassociated with the read request back to the file system 305. The filesystem 305 does not need intelligence to know that its requests tological sector addresses are actually mapped to physical sectoraddresses.

[0069] Power-Interruption Protection

[0070] Write operations are performed at the sector-level as opposed tothe block-level, which minimizes the potential for data loss during apower-failure situation. A sector worth of data is the finest level ofgranularity that is used with respect to most file systems 305.Therefore, if the flash driver 306 is implemented to operate at a persector basis, the potential for data loss during a power failure isreduced.

[0071] As mentioned above, data structures 600A, 600B are stored inmemory 304, which in one exemplary implementation is typically avolatile memory device subject to complete erasure in the event of apower failure. To safeguard data integrity on the flash medium 100/200,logical-to-physical mapping information stored in the data structures600A/600B is backed-up on the flash memory medium.

[0072] In one exemplary implementation, to reduce the cost associatedwith storing the entire data structure on the flash memory medium100/200, the logical sector address is stored in the spare 104 area ofthe medium with each physical sector in which the logical sector addresshas a corresponding relationship.

[0073]FIG. 8 illustrates a process 800 for safeguarding mapping oflogical-to-physical sector address information stored in volatile datastructures, such as exemplary data structures 600A and 600B. Process 800includes steps 802-814. The order in which the process is described isnot intended to be construed as a limitation. Furthermore, the processcan be implemented in any suitable hardware, software, firmware, orcombination thereof. In step 802, the logical sector address associatedwith the actual data is stored in the physical sector of the flashmemory medium 100/200 at the physical sector address assigned to thelogical sector address. In the case of a NAND flash memory medium 100,the logical sector address is stored in the spare area 104 of themedium. Using this scheme, the logical-to-physical sector mappinginformation is stored in a reverse lookup format. Thus, after a powerfailure situation, it is necessary to scan the spare area for eachphysical sector on the media, determine the corresponding logical sectoraddress, and then update the in-memory lookup table accordingly. FIG. 9illustrates a location with in media 100/200 in which the logical sectoraddress can be stored. As previously mentioned, blocks of NOR flashmemory can be logically subdivided into physical sectors each with aspare area (similar to NAND). Using this technique, the logical sectoraddress is stored in the spare area for each the physical sector similarto the process used with NAND flash memory (shown in FIG. 15 as space1504 to be described with reference to FIG. 15).

[0074] In the event there is a power interruption and the datastructures 600A, 600B are lost, as indicated by the YES branch ofdecisional step 804 of FIG. 8, then flash abstraction logic 308 uses theflash medium logic 310 to scan the flash memory medium to locate thelogical sector address stored with data in each physical address (seeFIG. 9), as indicated in step 806. In step 808, the physical sectoraddress in which data is contained is reassigned to the logical sectoraddress located with the data on the medium. As the physical and logicalsector address are reestablished they are stored back in the datastructures 600A, 600B and the flash medium logic 310 goes to the nextsector containing data as indicated in step 812. Steps 806-812 repeatuntil all sectors containing data have been are scanned and the datastructure is reestablished. Normally, this occurs at initialization ofthe computer device 300.

[0075] Accordingly, when a power failure occurs, process 800 enables theflash abstraction logic 308 to scan the medium 100/200 and rebuild thelogical-to-physical mapping in a data structure such as the exemplarydata structure 600. Process 800 ensures that mapping information is notlost during a power failure and that integrity of the data is retained.

[0076] Dynamic Look-up Data Structure for Tracking Data

[0077]FIG. 10 illustrates a dynamic look-up data structure 1000 to trackdata stored in the flash memory medium 100/200. Data structure 1000includes a master data structure 1002 and one or more secondary datastructures 1004, 1006. The data structures are generated and maintainedby the flash driver 306. The data structures are stored in a volatileportion of memory 304. The one or more secondary tables 1004, 1006contain mappings of logical-to-physical sector addresses. Each of thesecondary data structures 1004, 1006, as will be explained, has apredetermined capacity of mappings. The master data structure 1002contains a pointer to each of the one or more secondary data structures1004, 1006. Each secondary data structure is allocated on as neededbasis for mapping those logical-to-physical addresses that are used tostore data. Once the capacity of a secondary data structure 1004, 1006,etc., is exceeded, another secondary data structure is allocated, andanother, etc., until eventually all possible physical sector addresseson the flash medium 100/200 are mapped to logical sector addresses. Eachtime a secondary table is allocated, a pointer contained in the masterdata structure 1002 is enabled by the flash driver 306 to point to it.

[0078] Accordingly, the flash driver 306 dynamically allocates one ormore secondary data structures 1004, 1006 based on the amount ofpermanent data stored on the flash medium itself. The sizecharacteristics of the secondary data structures are computed atrun-time using the specific attributes of the flash memory medium100/200. Secondary data structures are not allocated unless thesecondary data structure previously allocated is full or insufficient tohandle the amount of logical address space required by the file system305. Dynamic look-up data structure 1000, therefore, minimizes usage ofmemory 304. Dynamic look-up data structure 1000 lends itself to computerdevices 300 that use calendars, inboxes, documents, etc. where most ofthe logical sector address space will not need to be mapped to aphysical sector address. In these applications, only a finite range oflogical sectors are repeatedly accessed and new logical sectors are onlywritten when the application requires more storage area.

[0079] The master data structure 1002 contains an array of pointers, 0through N that point to those secondary data structures that areallocated. In the example of FIG. 10, the pointers at location 0 and 1point to secondary data structures 1004 and 1006, respectively. Also, inthe example illustration of FIG. 10, pointers 2 through N do not pointto any secondary data structures and would contain a default setting,“NULL”, such that the logical-to-physical sector mapping module 404knows that there are no further secondary data structures allocated.

[0080] Each secondary data structure 1004, 1006 is similar to datastructures 600, but only a portion of the total possible medium ismapped in the secondary data structures. The secondary data structurespermit the flash abstraction logic 308 to reduce the amount space neededin memory 304, to only those portions of logical sectors addressesissued by the file system. Each secondary data structure is (b*k) bytesin size, where k is the number of physical sector addresses contained inthe data structure and b is the number of bytes used to store eachphysical sector address.

[0081]FIG. 11 illustrates a process 1100 for dynamically allocatinglook-up data structures for tracking data on the flash memory medium100/200. Process 1100 includes steps 1102 through 1106. The order inwhich the process is described is not intended to be construed as alimitation. Furthermore, the process can be implemented in any suitablehardware, software, firmware, or combination thereof.

[0082] In step 1102, a master data structure 1002 containing thepointers to one or more secondary data structures 1004, 1006 isgenerated. The master data structure 1002 in this exemplaryimplementation is fixed in size. At the time the computer device 300boots-up, the flash medium logic 310 determines the size of the flashmemory medium 100/200 and relays this information to the flashabstraction logic 308. Based on the size of the flash medium, the flashabstraction logic 308 calculates a range of physical addresses. That is,suppose the size of the flash medium is 16 MB, then a NAND flash medium100 will typically contain 32768 sectors each 512 bytes in size. Thismeans that the flash abstraction logic 308 may need to map a total of 0through 32768 logical sectors in a worse case scenario, assuming all thememory space is used on the flash medium. Knowing that there are 2¹⁵sectors on the medium, the flash abstraction logic 308 can use 2 bytesto store the physical sector address for each logical sector address. Sothe master data structure is implemented as an array of 256 DWORDs(N=256), which covers the maximum quantity of logical sector addresses(e.g., 32768) to be issued by the files system. So, there are a total of256 potential secondary data structures.

[0083] In step 1104 the secondary data structure(s) are allocated.First, the flash abstraction logic determines the smallest possible sizefor each potential secondary data structure. Using simple division,32768/256=128 logical sector addresses supported by each data structure.As mentioned above, the entire physical space can be mapped using 2bytes, b=2, therefore, each secondary data structure will by 256 bytesin size or (b=2*k=128).

[0084] Now, knowing the size of each secondary data structure, supposethat the file system 305 requests to write to logical sector addresses50-79, also known as LS50-LS79. To satisfy the write requests from thefiles system 305, the flash abstraction logic 308 calculates that thefirst pointer in master data structure 1002 is used for logical sectoraddresses LS0-LS127 or data structure 1004. Assuming the first pointeris NULL, the flash abstraction logic 308 allocates data structure 1004(which is 256 bytes in size) in memory 304. As indicated in step 1106,the flash abstraction logic 308 enables the pointer in position 0 of themaster data structure to point to data structure 1004. So, in thisexample, data structure 1004 is used to store the mapping informationfor logical sectors LS50-LS79.

[0085] The flash abstraction logic 308 allocates a secondary datastructure, if the file system 305 writes to the corresponding area inthe flash medium 100/200. Typically, only the logical sector addressesthat are used are mapped by the flash abstraction logic 308. So, in theworst case scenario, when the file system 305 accesses the entirelogical address space, then all 256 secondary data structures (only two,1004, 1006 are shown to be allocated in the example of FIG. 10), each256 bytes in size will be allocated requiring a total of 64 KB of spacein memory 304.

[0086] When an allocated data structure 1004, for instance, becomesinsufficient to store the logical sector address space issued by thefile system 305, then the flash abstraction logic 308 allocates anotherdata structure, like data structure 1006. This process of dynamicallyallocating secondary data structures also applies if data structure 1004becomes sufficient at a later time to again handle all the logicalsector address requests made by the file system. In this example, thepointer to data structure 1006 would be disabled by the flashabstraction logic 308; and data structure 1006 would become free spacein memory 304.

[0087] Uniform Wear Leveling and Recycling of Sectors

[0088]FIG. 12 is a diagram of flash memory medium 100/200 viewed and/ortreated as a continuous circle 1200 by the flash driver 306. Physicallythe flash memory media is the same as either media 100/200 shown inFIGS. 1 and 2, except the flash abstraction logic 308, organizes theflash memory medium as if it is a continuous circle 1200, containing0-to-N blocks. Accordingly, the highest physical sector address(individual sectors are not shown in FIG. 12 to simplify theillustration, but may be seen in FIGS. 1 and 2) within block N and thelowest physical sector address within block 0 are viewed as beingcontiguous.

[0089]FIG. 13 illustrates another view of media 100/200 viewed as acontinuous circle 1200. In this exemplary illustration, the sectormanager 402 maintains a write pointer 1302, which indicates a nextavailable free sector to receive data on the medium. The next availablefree sector is a sector that can accept data without the need to beerased first in a prescribed order. The write pointer 1102 isimplemented as a combination of two counters: a sector counter 1306 thatcounts sectors and a block counter 1304 that counts blocks. Bothcounters combined indicate the next available free sector to receivedata.

[0090] In an alternative implementation, the write pointer 1302 can beimplemented as a single counter and indicate the next physical sectorthat is free to accept data during a write operation. According to thisimplementation, the sector manager 402 maintains a list of all physicalsector addresses free to receive data on the medium. The sector manager402 stores the first and last physical sector addresses (the contiguousaddresses) on the medium and subtracts the two addresses to determine anentire list of free sectors. The write pointer 1302 then advancesthrough the list in a circular and continuous fashion. This reduces theamount of information needed to be stored by the sector manager 402.

[0091]FIG. 14 illustrates a process 1400 used by the sector manager 402to determine the next available free sector location for the flashdriver 306 to store data on the medium 100/200. Process 1400 alsoenables the sector manager 402 to provide each physical sector address(for the next free sector) for assignment to each logical sector addresswrite request by the file system 305 as described above. Process 1400includes steps 1402-1418. The order in which the process is described isnot intended to be construed as a limitation. Furthermore, the processcan be implemented in any suitable hardware, software, firmware, orcombination thereof.

[0092] In step 1402, the X block counter 1304 and Y sector counter 1306are initially set to zero. At this point it is assumed that no dataresides on the medium 100/200.

[0093] In step 1404, the driver 306 receives a write request and thesector manager 402 is queried to send the next available free physicalsector address to the logical-to-physical sector mapping module 404. Thewrite request may come from the file system 305 and/or internally fromthe compactor 406 for recycling sectors as shall be explained in moredetail below.

[0094] In step 1406, the data is written to the sector indicated by thewrite pointer 1302. Since both counters are initially set to zero inthis exemplary illustration, suppose that the write pointer 1302 pointsto sector zero, block zero.

[0095] In step 1408, the sector counter 1306 is advanced one validsector. For example, the write pointer advances to sector one of blockzero, following the example from step 1406.

[0096] Next, in decisional step 1410, the sector manager 402 checkswhether the sector counter 1306 exceeds the number of sectors K in ablock. If the Y count does not exceed the maximum sector size of theblock, then according to the NO branch of decisional step 1410, steps1404-1410 repeat for the next write request.

[0097] On the other hand, if the Y count does exceed the maximum sectorsize of the block, then the highest physical sector address of the blockwas written to and the block is full. Then according to the YES branchof step 1410, in step 1412 the Y counter is reset to zero. Next, in step1414, X block counter 1304 is incremented by one, which advances thewrite pointer 1302 to the next block at the lowest valid physical sectoraddress, zero, of that block.

[0098] Next, in decisional step 1416, the compactor 406 checks whetherthe X block counter is pointing to a bad block. If it is, X blockcounter 1304 is incremented by one. In one implementation, the compactor406 is responsible for checking this condition. As mentioned above, thesector manager stores all of the physical sector addresses that are freeto handle a write request. Entire blocks of physical sector addressesare always added by the compactor during a compaction or duringinitialization. So, the sector manager 402 does not have to check to seeif blocks are bad, although the sector manager could be implemented todo so. It should also be noted that in other implementations step 1416could be performed at the start of process 1400.

[0099] In step 1417, the X block counter 1304 is incremented until it ispointing to a good block. To avoid a continuous loop, if all the blocksare bad, then process 1400 stops at step 1416 and provides an indicationto a user that all blocks are bad.

[0100] Next in decisional step 1418, the sector manager checks whetherthe X block counter 1304 exceeds the maximum numbers of blocks N. Thiswould indicate that write pointer 1302 has arrived full circle (at thetop of circle 1200). If that is the case, then according to the YESbranch of step 1418, the process 1400 repeats and the X and Y counterare reset to zero. Otherwise, according to the NO branch of step 1418,the process 1400 returns to step 1404 and proceeds.

[0101] In this exemplary process 1400, the write pointer 1302 initiallystarts with the lowest physical sector address of the lowest addressedblock. The write pointer 1302 advances a sector at a time through to thehighest physical sector address of the highest addressed block and thenback to the lowest, and so forth. This continuous and circular process1400 ensures that data is written to each sector of the medium 100/200fairly and evenly. No particular block or sector is written to more thanany other, ensuring even wear-levels throughout the medium 100/200.Accordingly, process 1400 permits data to be written to the nextavailable free sector extremely quickly without expensive processingalgorithms used to determine where to write new data while maintainingeven wear-levels. Such conventional algorithms can slow the write speedof a computer device.

[0102] In an alternative implementation, it is possible for the writepointer 1302 to move in a counter clock wise direction starting withhighest physical sector address of the highest block address N anddecrement its counters. In either case, bad blocks can be entirelyskipped and ignored by the sector manager. Additionally, the counterscan be set to any value and do not necessarily have to start with thehighest or lowest values of for the counters.

[0103]FIG. 15 illustrates another view of media 100/200 viewed as acontinuous circle 1200. As shown in FIG. 15, the write pointer 1302 hasadvanced through blocks 0 through 7 and is approximately half waythrough circle 1200. Accordingly, blocks 0 through 7 contain dirty,valid data, or bad blocks. That is, each good sector in blocks 0 through7 is not free, and therefore, not available to receive new or modifieddata. Arrow 1504 represents that blocks 0 through 7 contain usedsectors. Eventually, the write pointer 1302 will either run out of freesectors to write to unless sectors that are marked dirty or are notvalid are cleared and recycled. To clear a sector means that sectors arereset to a writable state or in other words are “erased.” In order tofree sectors it is necessary to erase at least a block at a time. Beforea block can be erased, however, the contents of all good sectors arecopied to the free sectors to a different portion of the media. Thesectors are then later marked “dirty” and the block is erased.

[0104] The compactor 406 is responsible for monitoring the condition ofthe medium 100/200 to determine when it is appropriate to erase blocksin order to recycle free sectors back to the sector manager 402. Thecompactor 406 is also responsible for carrying out the clear operation.To complete the clear operation, the compactor 406, like the sectormanager 402, maintains a pointer. In this case, the compactor 406maintains a clear pointer 1502, which is shown in FIG. 15. The clearpointer 1502 points to physical blocks and as will be explained enablesthe compactor 406 to keep track of sectors as the medium 100/200 asblocks are cleared. The compactor 406 can maintain a pointer to a blockto compact next since an erase operation affects entire blocks. That is,when the compactor 406 is not compacting a block, the compactor 406points to a block.

[0105]FIG. 16 is a flow chart illustrating a process 1600 used by thecompactor to recycle sectors. Process 1600 includes steps 1602-1612. Theorder in which the process is described is not intended to be construedas a limitation. Furthermore, the process can be implemented in anysuitable hardware, software, firmware, or combination thereof. In step1602, the compactor 406 monitors how frequently the flash memory medium100/200 is written to or updated by the file system. This isaccomplished by specifically monitoring the quantities of free and dirtysectors on the medium 100/200. The number of free sectors and dirtysectors can be determined counting free and dirty sectors stored intables 600 and/or 900 described above.

[0106] In decisional step 1604, the compactor 406 performs twocomparisons to determine whether it is prudent to recycle sectors. Thefirst comparison involves comparing the amount of free sectors to dirtysectors. If the amount of dirty sectors outnumbers the free sectors,then the compactor 406 deems it warranted to perform a recyclingoperation, which in this case is referred to as a “service compaction.”Thus a service compaction is indicated when the number of dirty sectorsoutnumbers the quantity of free sectors.

[0107] If a service compaction is deemed warranted, then in step 1606the compactor waits for a low priority thread 1606, before seizingcontrol of the medium to carry out steps 1608-1612 to clear blocks ofdirty data. The service compaction could also be implemented to occur atother convenient times when it is optional to recycle dirty sectors intofree sectors. For instance, in an alternative implementation, when onethird of the total sectors are dirty, the flash abstraction logic 308can perform a service compaction. In either implementation, usually thecompactor 406 waits for higher priority threads to relinquish control ofthe processor 302 and/or flash medium 100/200. Once a low prioritythread is available, the process proceeds to step 1608.

[0108] Referring back to step 1604, the second comparison involvescomparing the amount of free sectors left on the medium, to determine ifthe write pointer 1302 is about to or has run out of free sectors topoint to. If this is the situation, then the compactor 406 deems itwarranted to order a “critical compaction” to recycle sectors. Thecompactor does not wait for a low priority thread and launchesimmediately into step 1608.

[0109] In step 1608, the compactor 406 operates at either a highpriority thread or low priority thread depending on step 1604. Ifoperating at a high level thread (critical compaction), the compactor1102 is limited to recycling a small number, e.g., 16 dirty sectors,into free sectors and return control of the processor back to computerdevice 300 to avoid monopolizing the processor 302 during such aninterruption.

[0110] Thirty two sectors per block are commonly manufactured for flashmedia, but other numbers of sectors, larger or smaller, could beselected for a critical compaction. Regardless of these sizecharacteristics, the number of sectors recycled during a criticalcompaction is arbitrary but must be at least 1 (in order to satisfy thecurrent WRITE request). A critical compaction stalls the file system 305from being able to complete a write; therefore, it is important tocomplete the compaction as soon as possible. In the case of a criticalcompaction, the compactor 406 must recycle at least one dirty sectorinto a free sector so that there is space on the medium to fulfill thepending write request. Having more than one sector recycled at a time,such as 16, avoids the situation where there are multiple pending writerequests and multiple critical compactions that are performedback-to-back, effectively blocking control of the processorindefinitely. So, while the number of sectors recycled chosen for acritical compaction can vary, a number sufficient to preventback-to-back critical compactions is implemented in the exemplarydescription.

[0111] So, in step 1608, the compactor 406 will use the clear pointer1502 to scan sectors for valid data, rewrite the data to free sectors,and mark a sector dirty after successfully moving data. Accordingly,when moving data, the compactor uses the same processes described withreference to process 700, which is the same code that is used when thefile system 305 writes new and/or updates data. The compactor 406queries the sector manager 402 for free sectors when moving data, in thesame fashion as described with reference to process 1400.

[0112] In step 1610, the compactor 406 moves the clear pointer 1502sector-by-sector using a sector counter like the write counter 1306shown in FIG. 13, except this sector counter pertains to the location ofthe clear pointer 1502. The compactor 406 also keeps track of blocksthrough a counter in similar fashion as described with reference to thewrite pointer 1302. However, the amount of blocks cleared is determinedby the number of dirty sectors with the exception of a criticalcompaction. In a critical compaction, the compactor only compacts enoughblocks to recycle a small number of physical sectors (i.e. 16 sectors).

[0113] In step 1612, the compactor erases (clears) those blocks whichcontain good sectors that are fully marked dirty. FIG. 17 showsexemplary results from process 1600. In this example, blocks 0 and 1were cleared and the clear pointer was moved to the first sector ofblock 2, in the event another compaction is deemed warranted. As aresult, the compactor 406 recycled two blocks worth of the sectors fromblocks 0 and 1, which provides more free sectors to the sector manager402. Used sectors 1504 forms a data stream (hereinafter a “data stream”1504) that rotates in this implementation in a clockwise fashion. Thewrite pointer 1302 remains at the head of the data stream 1504 and theclear pointer 1502 remains at the end or “tail” of the data stream 1504.The data stream 1504 may shrink as data is deleted, or grow as new datais added, but the pointers always point to opposite ends of the datastream 1504: head and tail.

[0114] Treating the flash memory medium as if the physical sectoraddresses form a continuous circle 1200, and using the processesdescribed above, enables the flash abstraction logic 308 to accomplishuniform wear-leveling throughout the medium 100/200. The compactor 406selects a given block the same number times for recycling of sectorsthrough erasure. Since flash blocks have a limited write/erase cycle,the compactor as well as the sector manager distributes these operationsacross blocks 0-N as evenly and as fairly as possible. In this regard,the data steam 1504 rotates in the circle 1200 (i.e. the medium 100/200)evenly providing perfect wear-levels on the flash memory medium 100/200.

[0115] In the event of power failure, the flash abstraction logic 310contains simple coded logic that scans the flash memory medium 100/200and determines what locations are marked free and dirty. The logic isthen able to deduce that the data stream 1504 resides between thelocations marked free and dirty, e.g., the data stream 1106 portion ofthe circle 1200 described in FIG. 17. The head and tail of the datastream 1504 is easily determined by locating the highest of the physicalsector addresses containing data for the head and by locating the lowestof the physical sector addresses containing data for the tail.

[0116] NOR Flash Devices

[0117] Although all the aforementioned sections in this DetailedDescription section apply to NAND and NOR flash devices, if a NOR flashmemory medium 200 is used, some additional implementation is needed forthe flash medium logic to support the storing of data in each physicalsector on the medium 200. Each NOR block 0, 1, 2, etc. can be treatedlike a NAND flash memory medium 100, by the flash medium logic 310.Specifically, each NOR block is subdivided into some number of pageswhere each page consists of a 512 byte “data area” for sector data andan 8 byte “spare area” for storing things like to the logical sectoraddress, status bits, etc. (as described above).

[0118]FIG. 18 illustrates a logical representation of a NOR flash memorymedium 200 divided in way to better support the processes and techniquesimplemented by the flash driver. In this implementation, sectors 1802contain a 512 byte data area 1803 for the storage of sector related dataand 8 bytes for a spare area 1804. Sections 1806 represent unusedportions of NOR blocks, because a NOR Flash block is usually a power of2 in size, which is not evenly divisible. For instance, consider a 16 MBNOR flash memory device that has 128 flash blocks each 128 KB in size.Using a page size equal to 520 bytes, each NOR flash block can bedivided into 252 distinct sectors with 32 bytes remaining unused.Unfortunately, these 32 bytes per block are “wasted” by the flash mediumlogic 310 in the exemplary implementation and are not used to storesector data. The tradeoff, however, is the enhanced write throughput,uniform wear leveling, data loss minimization, etc. all provided by theflash abstraction logic 308 of the exemplary flash driver 306 asdescribed above. Alternative implementations could be accomplished bydividing the medium 200 into different sector sizes.

[0119] Computer Readable Media

[0120] An implementation of exemplary subject matter using a flashdriver as described above may be stored on or transmitted across someform of computer-readable media. Computer-readable media can be anyavailable media that can be accessed by a computer. By way of example,and not limitation, computer readable media may comprise “computerstorage media” and “communications media.”

[0121] “Computer storage media” include volatile and non-volatile,removable and non-removable media implemented in any method ortechnology for storage of information such as computer readableinstructions, data structures, program modules, or other data. Computerstorage media includes, but is not limited to, RAM, ROM, EEPROM, flashmemory or other memory technology, CD-ROM, digital versatile disks (DVD)or other optical storage, magnetic cassettes, magnetic tape, magneticdisk storage or other magnetic storage devices, or any other mediumwhich can be used to store the desired information and which can beaccessed by a computer.

[0122] “Communication media” typically embodies computer readableinstructions, data structures, program modules, or other data in amodulated data signal, such as carrier wave or other transportmechanism. Communication media also includes any information deliverymedia.

[0123] The term “modulated data signal” means a signal that has one ormore of its characteristics set or changed in such a manner as to encodeinformation in the signal. By way of example, and not limitation,communication media includes wired media such as a wired network ordirect-wired connection, and wireless media such as acoustic, RF,infrared, and other wireless media. Combinations of any of the above arealso included within the scope of computer readable media.

[0124] Conclusion

[0125] Although the invention has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the invention defined in the appended claims is not necessarilylimited to the specific features or acts described. Rather, the specificfeatures and acts are disclosed as exemplary forms of implementing theclaimed invention.

What is claimed is:
 1. A flash driver system, comprising: a free sectormanager, configured to determine a next free physical sector address onthe media and assign the address to a logical sector address of a writerequest received from a file system; a table, configured to store a mapshowing the assignment of the physical sector address to the logicalsector address; and a flash medium logic, configured to write the datato the next free physical sector indicated by the free sector managerand store the logical sector address directly with the data on the flashmemory medium.
 2. The flash driver as recited in claim 1, furthercomprising a flash abstraction logic, configured to scan the sectors ofthe flash memory medium for the logical sector address and note thephysical sector address from which the logical sector address is storedand reestablish the map in the table in the event the table is erased.3. The flash driver as recited in claim 1, wherein the logical sectoraddress is stored in a spare portion of the flash memory medium.
 4. Aflash driver system, comprising: a free sector manager, configured todetermine a next free physical sector address available on the flashmemory medium; a flash abstraction logic, configured to query the freesector manager for the next free physical sector address and link thephysical sector address to a logical sector address received from a filesystem; and a table, configured to store the physical sector address tological sector address linking performed by the flash abstraction logic.5. The flash driver system as recited in claim 4, wherein the flashabstraction logic is further configured to mark an existing physicalsector as dirty, if a logical sector address received from the filesystem was previously linked to the logical sector address in the table.6. The flash driver system as recited in claim 4, wherein the flashabstraction logic is further configured to mark an existing physicalsector as dirty, if a logical sector address received from the filesystem was previously linked to the logical sector address in the table,but only after data associated with the logical sector address issuccessfully written to a new physical sector address on the flashmemory media.
 7. The flash driver system as recited in claim 4, whereina portion of a physical sector is a status bit configured to indicatewhen a write operation is in progress.
 8. The flash driver system asrecited in claim 4, wherein a portion of physical sector is a status bitconfigured to indicate when a write operation has been completedsuccessfully.
 9. A memory device comprising: a free sector manager todetermine a next free physical sector address on a flash memory mediumand to assign the physical sector address to a logical sector address;and an assignment map to store data corresponding to the physical sectoraddress to the logical sector address assignment, wherein the next freephysical sector accepts data without requiring to be erased first.
 10. Amemory device as recited in claim 9, wherein the free sector managerassists in evenly wearing the flash memory medium by not requiring asame physical sector to be erased repeatedly prior to other availablephysical sectors of the flash memory medium.
 11. A memory device asrecited in claim 9, wherein a write request provides the logical sectoraddress.
 12. A memory device as recited in claim 9, wherein a writerequest received from a file system provides the logical sector address.13. A memory device as recited in claim 9, wherein the assignment map isstored in a table.
 14. A memory device as recited in claim 9, whereinthe logical sector address is stored in a spare portion of the flashmemory medium.
 15. A memory device as recited in claim 9, wherein theflash memory medium is a memory medium selected from a group comprisinga NAND flash memory medium and a NOR flash memory medium.
 16. A memorydevice as recited in claim 9, further comprising a flash medium logic towrite received data to the next free physical sector indicated by thefree sector manager.
 17. A memory device as recited in claim 9, furthercomprising a flash medium logic to store the logical sector address onthe flash memory medium.
 18. A memory device as recited in claim 9,further comprising a flash abstraction logic to scan one or more sectorsof the flash memory medium for the logical sector address and note thephysical sector address from which the logical sector address is storedand reestablish the assignment map in the event the assignment map iserased.
 19. A memory device as recited in claim 9, further comprising aflash abstraction logic to scan one or more blocks of the flash memorymedium for the logical sector address and note the physical sectoraddress from which the logical sector address is stored and reestablishthe assignment map in the event the assignment map is erased.
 20. Amethod comprising: determining a next free physical sector address on aflash memory medium; assigning the physical sector address to a logicalsector address; and generating an assignment map of data correspondingto the physical sector address to the logical sector address assignment,wherein the next free physical sector accepts data without requiring tobe erased first.
 21. A method as recited in claim 20, wherein a writerequest provides the logical sector address.
 22. A method as recited inclaim 20, wherein a write request from a file system provides thelogical sector address.
 23. A method as recited in claim 20, furthercomprising evenly wearing the flash memory medium by not requiring asame physical sector to be erased repeatedly prior to other availablephysical sectors of the flash memory medium.
 24. A method as recited inclaim 20, further comprising storing the assignment map in a table. 25.A method as recited in claim 20, further comprising storing the logicalsector address in a spare portion of the flash memory medium.
 26. Amethod as recited in claim 20, wherein the flash memory medium is amemory medium selected from a group comprising a NAND flash memorymedium and a NOR flash memory medium.
 27. A method as recited in claim20, further comprising writing data to the next free physical sector.28. A method as recited in claim 20, further comprising storing thelogical sector address on the flash memory medium.
 29. A method asrecited in claim 20, further comprising: scanning one or more sectors ofthe flash memory medium for the logical sector address; noting thephysical sector address from which the logical sector address is stored;and reestablishing the assignment map in the event the assignment map iserased.
 30. A method as recited in claim 20, further comprising:scanning one or more blocks of the flash memory medium for the logicalsector address; noting the physical sector address from which thelogical sector address is stored; and reestablishing the assignment mapin the event the assignment map is erased.
 31. One or morecomputer-readable media comprising computer-executable instructionsthat, when executed, perform the method as recited in claim
 20. 32. Anapparatus comprising: means for determining a next free physical sectoraddress on a flash memory medium; means for assigning the physicalsector address to a logical sector address; and means for generating anassignment map of data corresponding to the physical sector address tothe logical sector address assignment.
 33. An apparatus as recited inclaim 32, wherein the next free physical sector accepts data withoutrequiring to be erased first.
 34. An apparatus as recited in claim 32,further comprising means for storing the assignment map in a table. 35.An apparatus as recited in claim 32, further comprising means forstoring the logical sector address in a spare portion of the flashmemory medium.
 36. An apparatus as recited in claim 32, furthercomprising means for writing data to the next free physical sector. 37.An apparatus as recited in claim 32, further comprising means forstoring the logical sector address on the flash memory medium.
 38. Anapparatus as recited in claim 32, further comprising means forreestablishing the assignment map in the event the assignment map iserased.